<template>
    <div id="cart">
     <p>
        <i>添加商品至购物车</i>
    </p>
    <ul>
        <li v-for="item in cartStore.cartProducts" :key="item.id">
            {{item.title}} - {{item.price}} x {{item.quantity}}
        </li>
    </ul>
    <p>商品总价: {{cartStore.totalPrice}}</p>
    <p>
        <button>结算</button>
    </p>
    <p v-show="cartStore.checkout">结算{{cartStore.checkoutStatus}}</p>
    </div>
</template>

<script setup lang="ts">
import {useCartStore} from '../store/cart'

const cartStore = useCartStore()
</script>
